/*
 * desc: 描述
 * Author: jayafs
 * Email: 1169655050@qq.com
 * Date: 2020-11-26 21:43:49
 * LastEditors: Please set LastEditors
 * LastEditTime: 2020-11-27 09:54:19
 */
import dayjs from 'dayjs';

export default function timeFormat(
  time: string | number | undefined,
  type: string | undefined = undefined,
) {
  switch (type) {
    case 'all':
      return dayjs(time).format('YYYY-MM-DD HH:mm:ss');
    default:
      return dayjs(time).format('YYYY-MM-DD');
  }
}
